CFLAGS = -Wall -c

all: project.exe

project.exe: main.o video-graphics.o labirinto.o sprite.o play.o queue.o ints.o handler.o music.o timer.o rtc.o
	gcc main.o video-graphics.o labirinto.o sprite.o play.o queue.o ints.o handler.o music.o timer.o rtc.o -o project.exe

main.o: main.c sprite.h sprite.c pixmap.h
	gcc $(CFLAGS) main.c
	
play.o: play.h play.c sprite.h sprite.c ints.h ints.c queue.h queue.c labirinto.h labirinto.c video-graphics.h video-graphics.c timer.h timer.c music.h music.c rtc.h rtc.c 
	gcc $(CFLAGS) play.c
	
labirinto.o: labirinto.h labirinto.c video-graphics.h video-graphics.c
	gcc $(CFLAGS) labirinto.c	
	
video_graphics.o: video-graphics.h video-graphics.c
	gcc $(CFLAGS) video-graphics.c
	
sprite.o: sprite.h sprite.c
	gcc $(CFLAGS) sprite.c
	
queue.o: queue.h queue.c
	gcc $(CFLAGS) queue.c

ints.o: ints.h ints.c
	gcc $(CFLAGS) ints.c
	
handler.o: handler.asm
	nasm -t -f coff handler.asm
	
music.o: music.h music.c timer.h timer.c
	gcc $(CFLAGS) music.c	
	
timer.o: timer.h timer.c
	gcc $(CFLAGS) timer.c
	
rtc.o: rtc.h rtc.c
	gcc $(CFLAGS) rtc.c
	
clean:
	del project.exe
	del *.o